home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 1 / Eagles_Nest_Mac_Collection_Disc_1.TOAST / HyperCard & XCMD⁄XFCN / HamNovTest41 / Novice Ham Test / card_11003.txt < prev    next >
Text File  |  1993-04-11  |  6KB  |  258 lines

  1. -- card: 11003 from stack: in
  2. -- bmap block id: 4810
  3. -- flags: 4000
  4. -- background id: 10612
  5. -- name: report
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global immediate,questlist,questkey,questans,firstentry
  9.   --** if necessary to save this card, copy card, rename by adding
  10.   --** "_name" to end of card name, then delete from here down to --**
  11.   put false into immediate
  12.   put the long time into field "stop"
  13.   put empty into score
  14.   put empty into field qmissed
  15.   repeat with i=1 to number of items of questlist
  16.     if item i of questans = item i of questkey then
  17.       add 1 to score
  18.     else
  19.       put field qmissed & i & "," into field qmissed
  20.       --put field qmissed & item i of questlist & "," into field qmissed
  21.     end if
  22.   end repeat
  23.   set lockscreen to true
  24.  
  25.   delete last character of field qmissed
  26.   --** and put correct score in next line (and uncomment)
  27.   --** put 22 into score -- replace 22 with correct score
  28.   --** also copy card savedscores, rename by adding "_name", and
  29.   --** edit script for the print button to call correct card names
  30.   if score is empty then put "0" into field "correct"
  31.   else put score into field "correct"
  32.   put the number of items of questlist into field "Q#"
  33.   if field "Q#" > 0 then
  34.     put score*100/field "Q#" & "%" into field "Percent"
  35.     put score*100/field "Q#" into foo
  36.   else
  37.     put "0%" into field "Percent"
  38.     put "0" into foo
  39.   end if
  40.  
  41.   if foo >= 90 then play applause
  42. end opencard
  43.  
  44. on build_savedscores
  45.   global questlist,questans
  46.   global username
  47.   put empty into savedscore1
  48.   put empty into savedscore2
  49.   put empty into savedscore3
  50.   repeat with i=1 to number of items of questlist
  51.     if i < 18 then
  52.       put savedscore1&item i of questans&return into savedscore1
  53.     else if i < 35 then
  54.       put savedscore2&item i of questans&return into savedscore2
  55.     else
  56.       put savedscore3&item i of questans&return into savedscore3
  57.     end if
  58.   end repeat
  59.  
  60.   go card savedscores
  61.   put username into cd field name
  62.   put the date into cd field date
  63.   put savedscore1 into field ans1
  64.   put savedscore2 into field ans2
  65.   put savedscore3 into field ans3
  66. end build_savedscores
  67.  
  68. on savesc
  69.   global username
  70.   doMenu "Copy Card"
  71.   doMenu "Paste Card"
  72.   set name of this card  to "report_" & username
  73.   set cantDelete of this card to false
  74.   set the script of this card to empty
  75.   set the script of button "save scores" to empty
  76.   set the script of button "Print Score" to empty
  77.   build_savedscores
  78.   doMenu "Copy Card"
  79.   doMenu "Paste Card"
  80.   set name of this card  to "savedscores_" & username
  81.   set cantDelete of this card to false
  82.   set the script of this card to empty
  83.   show  button "Delete Saved"
  84.   show  button "Print Score"
  85.   go card report
  86. end savesc
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. -- part 2 (button)
  94. -- low flags: 00
  95. -- high flags: A003
  96. -- rect: left=192 top=296 right=323 bottom=234
  97. -- title width / last selected line: 0
  98. -- icon id / first selected line: 0 / 0
  99. -- text alignment: 1
  100. -- font id: 0
  101. -- text size: 12
  102. -- style flags: 0
  103. -- line height: 16
  104. -- part name: yes
  105. ----- HyperTalk script -----
  106. on mouseUp
  107.   global questlist -- question # option
  108.   if field qmissed of card report is empty then
  109.     answer "Perfect score! No need to review." with "OK"
  110.     exit mouseUp
  111.   end if
  112.   put field qmissed of card report into numWrong
  113.   repeat with x=1 to the number of items of numWrong
  114.     put empty into field qmissed of card report
  115.     get item x of numWrong
  116.     get item it of questlist -- only required for question # option
  117.     go card it
  118.     reView
  119.   end repeat
  120.   go card report
  121.   put numWrong into field qmissed of card report
  122. end mouseUp
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. -- part 3 (button)
  139. -- low flags: 00
  140. -- high flags: A003
  141. -- rect: left=240 top=296 right=323 bottom=334
  142. -- title width / last selected line: 0
  143. -- icon id / first selected line: 0 / 0
  144. -- text alignment: 1
  145. -- font id: 0
  146. -- text size: 12
  147. -- style flags: 0
  148. -- line height: 16
  149. -- part name: no, new test
  150. ----- HyperTalk script -----
  151. on mouseUp
  152.   global score,lockkey
  153.   put empty into field "QMissed"
  154.   put empty into score
  155.   put false into lockkey
  156.   go first card
  157. end mouseUp
  158.  
  159.  
  160.  
  161.  
  162.  
  163. -- part 4 (button)
  164. -- low flags: 00
  165. -- high flags: A000
  166. -- rect: left=413 top=290 right=334 bottom=492
  167. -- title width / last selected line: 0
  168. -- icon id / first selected line: 1007 / 1007
  169. -- text alignment: 1
  170. -- font id: 0
  171. -- text size: 12
  172. -- style flags: 0
  173. -- line height: 16
  174. -- part name: Print Score
  175. ----- HyperTalk script -----
  176. on mouseUp
  177.   lock screen
  178.   open printing
  179.   print this card
  180.   put field QMissed&"," into field QMissed
  181.   build_savedscores
  182.   print this card
  183.   close printing
  184.   go card report
  185.   unlock screen
  186. end mouseUp
  187.  
  188.  
  189.  
  190. -- part 6 (button)
  191. -- low flags: 00
  192. -- high flags: 0000
  193. -- rect: left=363 top=295 right=332 bottom=401
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 21700 / 21700
  196. -- text alignment: 1
  197. -- font id: 0
  198. -- text size: 12
  199. -- style flags: 0
  200. -- line height: 16
  201. -- part name: Home
  202. ----- HyperTalk script -----
  203. on mouseUp
  204.   visual effect iris close
  205.   go home
  206. end mouseUp
  207.  
  208.  
  209.  
  210.  
  211. -- part 12 (button)
  212. -- low flags: 00
  213. -- high flags: A000
  214. -- rect: left=421 top=133 right=189 bottom=487
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 12451 / 12451
  217. -- text alignment: 1
  218. -- font id: 0
  219. -- text size: 12
  220. -- style flags: 0
  221. -- line height: 16
  222. -- part name: save scores
  223. ----- HyperTalk script -----
  224. on mouseUp
  225.   global username
  226.   put "This will create card savedscores_" & username into foo
  227.   answer foo with "OK" or "Cancel"
  228.   if it is "Cancel" then
  229.     exit mouseUp
  230.   end if
  231.   get userlevel
  232.   put it into savedlevel
  233.   set the userlevel to 5
  234.   savesc
  235.   set the userlevel to savedlevel
  236. end mouseUp
  237.  
  238.  
  239.  
  240. -- part contents for background part 1
  241. ----- text -----
  242. 10:03:33 PM
  243.  
  244. -- part contents for background part 2
  245. ----- text -----
  246. 10:02:43 PM
  247.  
  248. -- part contents for background part 3
  249. ----- text -----
  250. 28
  251.  
  252. -- part contents for background part 4
  253. ----- text -----
  254. 30
  255.  
  256. -- part contents for background part 5
  257. ----- text -----
  258. 93.333333%